// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    motto: 'Hello World',
    // 轮播列表
    swiperList:[
        {
            text:'测试1'
        },
        {
            text:'测试2'
        }
    ],
    // 功能一列表
    numberList:[
        {
            icon:'../../image/navIcon/work.png',
            text:'功能1'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能2'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能3'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能4'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能5'
        }
    ],
    // 功能二列表
    letterList:[
        {
            icon:'../../image/navIcon/work.png',
            text:'功能A',
            list:[
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能1'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能2'
               },
               {
                    icon:'../../image/navIcon/work.png',
                    text:'功能3'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能4'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能4'
                }
            ]
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能B',
            list:[
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能1'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能2'
               },
               {
                    icon:'../../image/navIcon/work.png',
                    text:'功能3'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能4'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能5'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能6'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能7'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能8'
                },
                {
                    icon:'../../image/navIcon/work.png',
                    text:'功能9'
                }
            ]
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能C'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能D'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能E'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能F'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能G'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能H'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能I'
        },
        {
            icon:'../../image/navIcon/work.png',
            text:'功能J'
        }
    ],
    popupShow:false,
    popupForm:{
        title:'',
        list:[]
    }
  },
//   功能二列表点击事件
  handleClick(e){
    let {
        items
    } = e.currentTarget.dataset;
    let form = {title:items.text,list:items.list?items.list:[]}
    console.log('111',items);
    console.log(form);
    if(items.text == '功能B'){
        this.setData({
            popupForm:form,
            popupShow:true
        })
    }
},
popClick(){
    this.setData({
        popupShow:false
    });
},
  // 事件处理函数
  bindViewTap() {
      
  },
  onLoad() {

  },
  getUserProfile(e) {
    // 推荐使用wx.getUserProfile获取用户信息，开发者每次通过该接口获取用户个人信息均需用户确认，开发者妥善保管用户快速填写的头像昵称，避免重复弹窗
    // wx.getUserProfile({
    //   desc: '展示用户信息', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
    //   success: (res) => {
    //     console.log(res)
    //     this.setData({
    //       userInfo: res.userInfo,
    //       hasUserInfo: true
    //     })
    //   }
    // })
  },
  getUserInfo(e) {
    // 不推荐使用getUserInfo获取用户信息，预计自2021年4月13日起，getUserInfo将不再弹出弹窗，并直接返回匿名的用户个人信息
    // console.log(e)
    // this.setData({
    //   userInfo: e.detail.userInfo,
    //   hasUserInfo: true
    // })  console.log(e)
    // this.setData({
    //   userInfo: e.detail.userInfo,
    //   hasUserInfo: true
    // })
  }
})
